/*
 * Copyright 2009 SHOP.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shop.opensocial.mediated.driver;

import com.shop.opensocial.mediated.config.MediatedDriverFactory;
import com.shop.opensocial.mediated.services.ActivityServiceMediator;
import com.shop.opensocial.mediated.services.AppDataServiceMediator;
import com.shop.opensocial.mediated.services.AuthenticationHandlerMediator;
import com.shop.opensocial.mediated.services.GadgetContextHandlerMediator;
import com.shop.opensocial.mediated.services.OAuthDataStoreMediator;
import com.shop.opensocial.mediated.services.OAuthStoreMediator;
import com.shop.opensocial.mediated.services.PersonServiceMediator;

/**
 * This is the main interface between the Mediated implementation and your application. You must implement this interface as a singleton
 * and then call {@link MediatedDriverFactory#setDriver(OpenSocialServiceMediatorDriver)} passing in the instance. The Mediated implementation
 * will then call the methods to get service implementations as needed. The service implementations returned should be singletons.
 *
 * @author Jordan Zimmerman
 */
public interface OpenSocialServiceMediatorDriver
{
	/**
	 * Called to get the Person Service singleton
	 *
	 * @return person service
	 */
	public PersonServiceMediator getPersonServiceMediator();

	/**
	 * Called to get the Activity Service singleton
	 *
	 * @return activity service
	 */
	public ActivityServiceMediator getActivityServiceMediator();

	/**
	 * Called to get the App Data Service singleton
	 *
	 * @return app data service
	 */
	public AppDataServiceMediator getAppDataServiceMediator();

	/**
	 * Called to get the authentication singleton
	 *
	 * @return authentication handler
	 */
	public AuthenticationHandlerMediator getAuthenticationHandlerMediator();

	/**
	 * Called to get the OAuthStore singleton
	 *
	 * @return OAuth store
	 */
	public OAuthStoreMediator		getOAuthStoreMediator();

	/**
	 * Called to get the OAuthDataStore singleton
	 *
	 * @return OAuth data store
	 */
	public OAuthDataStoreMediator 	getOAuthDataStoreMediator();

	/**
	 * Called to get the GadgetContextHandlerMediator singelton
	 *
	 * @return GadgetContextHandlerMediator
	 */
	public GadgetContextHandlerMediator getGadgetContextHandlerMediator();

	/**
	 * Called whenever the internal Mediated implementation catches an exception. This method is mostly
	 * for debugging purposes
	 *
	 * @param e the caught exception
	 */
	public void		exceptionThrown(Throwable e);
}
